package com.qige.homework.test;

class Teacher{
    private String name;
    private int age;
    private String content;

    public Teacher() {
    }

    public Teacher(String name, int age, String content) {
        this.name = name;
        this.age = age;
        this.content = content;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }
    public void eat(){
        System.out.println("年龄为" + age + "的" + name + "老师正在吃饭....");
    }
    public void teach(){
        System.out.println("年龄为" + age + "的" + name + "老师正在亢奋的讲着"+content+"的知识........");
    }
}
class Student{
    private String name;
    private int age;
    private String content;
    public Student() {
    }
    public Student(String name, int age, String content) {
        this.name = name;
        this.age = age;
        this.content = content;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }
    public void eat(){
        System.out.println("年龄为" + age + "的" + name + "同学正在吃饭....");
    }
    public void study(){
        System.out.println("年龄为" + age + "的" + name + "同学正在专心致志的听着" + content + "的知识....");
    }
}
public class homework4 {
    public static void main(String[] args) {
        Teacher teacher1 = new Teacher("周志鹏",30, "Java基础中面向对象");
        teacher1.eat();
        teacher1.teach();
        Student student1 = new Student("韩光", 18, "面向对象");
        student1.eat();
        student1.study();
        Teacher teacher2 = new Teacher();
        teacher2.setName("周志鹏");
        teacher2.setAge(30);
        teacher2.setContent("Java基础中面向对象");
        teacher2.eat();
        teacher2.teach();
        Student student2 = new Student();
        student2.setName("韩光");
        student2.setAge(18);
        student2.setContent("面向对象");
        student2.eat();
        student2.study();
    }
}
